﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
	x:Class="myBoard.Framework.ConfigButton"
	x:Name="UserControl">
	<UserControl.Resources>
		
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#F3F3F3" Offset="0"/>
			<GradientStop Color="#EBEBEB" Offset="0.5"/>
			<GradientStop Color="#DDDDDD" Offset="0.5"/>
			<GradientStop Color="#CDCDCD" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
		<Style x:Key="TransparentButton" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<ContentPresenter/>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true"/>
							<Trigger Property="ToggleButton.IsChecked" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Storyboard x:Key="Intro">
			<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_ellipse" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
				<SplineColorKeyFrame KeyTime="00:00:00.3000000" Value="#18000000" KeySpline="0,1,1,1"/>
			</ColorAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="Outro">
			<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_ellipse" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
				<SplineColorKeyFrame KeyTime="00:00:00.3000000" Value="#00000000" KeySpline="0,1,1,1"/>
			</ColorAnimationUsingKeyFrames>
		</Storyboard>
		
	</UserControl.Resources>
	<UserControl.Triggers>
		<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="_button">
			<BeginStoryboard Storyboard="{StaticResource Intro}"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="_button">
			<BeginStoryboard x:Name="Outro_BeginStoryboard" Storyboard="{StaticResource Outro}"/>
		</EventTrigger>
	</UserControl.Triggers>

	<Grid x:Name="LayoutRoot">
		<Button x:Name="_button" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{DynamicResource TransparentButton}">
			<Grid Width="Auto" Height="Auto">
				<Ellipse x:Name="_ellipse" Fill="#00000000" Stroke="#FF000000" StrokeThickness="0" Margin="0,0,0,2" Height="18" Width="18"/>
				<TextBlock x:Name="_i" HorizontalAlignment="Center" Margin="0,0,2,0" VerticalAlignment="Center" FontFamily="Monotype Corsiva" FontSize="16" FontWeight="Normal" Foreground="#FFFFFFFF" Text="i" TextWrapping="Wrap"/>
			</Grid>
		</Button>
	</Grid>
</UserControl>